package view;

import entity.Color;
import service.BorrowBookServiceImpl;
import tool.TSUtility;

public class BorrowBookView {

    public static void main(String[] args) {
        BorrowBookView();
    }
    public static void BorrowBookView() {
        BorrowBookServiceImpl borrowBookService = new BorrowBookServiceImpl();
        boolean flag = true;
        while (flag) {
            System.out.print(Color.getAnsiBlue() + Color.getAnsiGreen());
            System.out.println("🔣-------~借阅图书~-----------🔣");
            System.out.println("🐕-------<1.借书>-----------*");
            System.out.println("🐖-------<2.还书>-----------*");
            System.out.println("🐱-------<3.查询借阅记录>-----*");
            System.out.println("🐱-------<4.退出>-----------*");
            char c = TSUtility.readMenuSelection();
            System.out.println("输入你的选择");
            switch (c) {
                case '1':
                    borrowBookService.borrowBooks();
                    break;
                case '2':
                    borrowBookService.returnBooks();
                    break;
                case '3':
                    borrowBookService.getAll();
                    break;
                case '4':
                    flag = false;
                    break;
            }
        }
    }



}
